package com.hellobike.haxing.modules.purchase.enums;

/**
 * Created by zhanglei on 2020/2/14.
 */
public enum OrderState {
    ORDER_STATE_0("待供应商确认", 0),
    ORDER_STATE_1("待采购审核", 1),
    ORDER_STATE_2("取消采购", 2),
    ORDER_STATE_3("供应商备货中", 3),
    ORDER_STATE_4("正在打包", 4),
    ORDER_STATE_5("已经发货", 5),
    ORDER_STATE_6("入库中", 6),
    ORDER_STATE_7("入库完成", 7),
    ORDER_STATE_8("部分入库完成", 8),
    ORDER_STATE_9("采购完成", 9);
    // 成员变量
    private String name;
    private int index;
    // 构造方法
    private OrderState(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (OrderState c : OrderState.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
